// pages/order/logis/oneLogistical.js
const app = getApp()
var util = require('../../../utils/util.js')
var http = require('../../../utils/server.js')
Page({

  data: {
    expressName: "",
    number: "",
    code: '',
  },

  onLoad: function(options) {
    console.log(options)
    var that = this;
    that.setData({
      number: options.number || '',
      code: options.code || ''
    })
    that.getData()
  },
  getData: function() {
    var that = this;
    http.post({
      url: "Address/getAllExpress",
      type: ''
    }, function(data) {
      var order = that.data.order
      for (var i = 0; i < data.length; i++) {
        if (that.data.code == data[i].code) {
          that.setData({
            expressName: data[i].name
          });
        }
      }
      that.load()
    })
  },
  load: function() {
    var that = this;
    http.post({
      url: "order/getLogistics",
      code: that.data.code,
      num: that.data.number,
    }, function(data) {
      that.setData({
        data: data.data
      });
    })
  },
})